import pandas as pd
import matplotlib.pyplot as plt
#读取911.csv文件
data=pd.read_csv('D:\多余\911.csv')
#统计每个地区紧急电话数量
emergency_calls_by_region=data['twp'].value_counts()
#绘制折线图
plt.figure(figsize=(12,6))
emergency_calls_by_region.plot(kind='line',marker='o',color='skyblue')
plt.title('Number of Emergency Calls by Region')
plt.xlabel('Region')
plt.ylabel('Number of Calls')
plt.xticks(rotation=45)
plt.grid(True)
plt.tight_layout()
plt.show()